package com.googlecode.jmicroerp.wicket.components.grid;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Alexandru.Codescu
 */
public class ActionButtons implements Serializable {
    private static final long serialVersionUID = 1L;
    private List<ActionButton> modifyButtons;
    private ActionButton insertButton;

    public ActionButtons(ActionButton... actionButtons) {
        modifyButtons = new ArrayList<ActionButton>();
        if (actionButtons.length > 0) {
            insertButton = actionButtons[0];
        } else {
            insertButton = new ActionButton(new PageParameters(null)) {

                @Override
                public boolean canDisplay() {
                    return false;
                }
                
            };
        }
        for (ActionButton actionButton : actionButtons) {
            modifyButtons.add(actionButton);
        }
    }
    
    public List<ActionButton> getModifyButtons() {
        return modifyButtons;
    }

    public void setModifyButtons(List<ActionButton> modifyButtons) {
        this.modifyButtons = modifyButtons;
    }

    public ActionButton getInsertButton() {
        return insertButton;
    }

    public void setInsertButton(ActionButton insertButton) {
        this.insertButton = insertButton;
    }
}
